#!/usr/bin/env bash

NOWDIR=$(cd "$(dirname "$0")"; pwd)/../..
cd $NOWDIR

find . -name .git -type d -execdir git pull -v ';'

source fckoa/sh/init.sh

if [ ! -d node_modules ]; then
yarn --production
npm rebuild bcrypt --build-from-source
fi


OUTPUT=`mktemp`.zip
echo $OUTPUT

zip -r $OUTPUT node_modules fckoa url -x *.git*

./fckoa/sh/dist.coffee --file $OUTPUT
